<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <h1>原生Ajax</h1>
</body>
<script>
   var xhr=new XMLHttpRequest();    
   //建立连接   OPEN(请求类型,路径,请求方式默认异步)
   var url="https://autumnfish.cn/api/joke/list?num=3";
   xhr.open("get",url);
    // xhr.open("POST",url,false);
    xhr.send();
    xhr.onreadystatechange=function(){
        if (xhr.readyState==4){
            // readyState == 4说明请求已完成
            if (xhr.status==200 || xhr.status==304){
                //返回的数据
                // console.log(xhr.responseText);
                // callback(xhr.responseText);
            }
            }
    }
    xhr.send(data);


</script>
</html>